package com.example.feigncustomer.web;

import com.example.feigncustomer.service.ServiceHi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: TestController
 * @Description: TODO
 * @Author: YangGuisen
 * @Date: 2018/7/12 17:47
 * @Version: 1.0
 */
@RestController
public class TestController {

    Logger logger = LoggerFactory.getLogger(TestController.class);
    @Autowired
    ServiceHi serviceHi;

    @GetMapping("/hi")
    public String testFei(@RequestParam("name") String name){
        logger.info("feign :收到消息了");
        String str = serviceHi.getStr(name);
        logger.info("feign :取得的数据为：{} ",str);
        return  "feign recived:"+str;
    }
}
